/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ortustve.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;

import ortustve.*;
/**
 *
 * @author Aaron
 */
public class date extends ortusvars{
	public static long GetEpochFromDate(String timestamp) {
		try {
			return new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").parse(timestamp).getTime();
		} catch (ParseException ex) {
			return 0;
		}
	}

	public static int GetyyyyMMdd(long timestamp){
		SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
		try {
			return Integer.parseInt(sdf.format(timestamp));
		} catch (Exception ex){
			return 0;
		}
	}
	public static String GetMMMMyyyy(long timestamp){
		SimpleDateFormat sdf = new SimpleDateFormat("MMMM yyyy");
		try {
			return sdf.format(timestamp);
		} catch (Exception ex){
			return "0";
		}
	}
}
